package com.demo.designmode.factory.simple;

/**
 * @Author: jxm
 * @Description: 专门用于创建披萨的工厂类
 * @Date: 2021/7/6 15:36
 * @Version: 1.0
 */
public class SimplePizzaFactory {

    public Pizza createPizza(String type) {
        Pizza pizza = null;

        if (type.equals("cheese")) {
            pizza = new CheesePizza();
        } else if (type.equals("clam")) {
            pizza = new ClamPizza();
        } else if (type.equals("pepperoni")) {
            pizza = new PepperoniPizza();
        }
        return pizza;
    }

}
